package com.grad.why.studentsystem.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.grad.why.studentsystem.domain.Runtimecoursearrangeinforecord;
import com.grad.why.studentsystem.domain.Student;
import com.grad.why.studentsystem.mapper.RuntimecoursearrangeinforecordMapper;
import com.grad.why.studentsystem.service.RuntimeCourseArrangeInfoDetailService;
import com.grad.why.studentsystem.service.RuntimeCourseArrangeInfoRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


import java.util.List;

@Component
@Service(interfaceClass = RuntimeCourseArrangeInfoRecordService.class)
public class RuntimeCourseArrangeInfoRecordServiceImpl implements RuntimeCourseArrangeInfoRecordService {
    @Autowired
    private RuntimecoursearrangeinforecordMapper runtimecoursearrangeinforecordMapper;

    @Override
    public List<Runtimecoursearrangeinforecord> getStudentArriveInfoList(int offset, int limit, String sort, String search) {
        try{
            return runtimecoursearrangeinforecordMapper.getStudentArriveInfoList(offset,limit,sort,search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public long getStudentArriveInfoListLength(String search) {
        try{
            return runtimecoursearrangeinforecordMapper.getStudentArriveInfoListLength(search);
        }catch (Exception E){
            E.printStackTrace();
        }
        return 0;
    }

    @Override
    public int deleteRuntimeCourseArrangeInfoRecordById(long i) {
        try{
            return runtimecoursearrangeinforecordMapper.deleteByPrimaryKey(i);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<Student> getShouldArriveStudentNameLabels(Integer courseArrangeId) {
        try{
            return runtimecoursearrangeinforecordMapper.getShouldArriveStudentNameLabels(courseArrangeId);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public Runtimecoursearrangeinforecord getRuntimeCourseArrangeInfoRecordByRecordId(int transformRecordId) {
        try{
            return runtimecoursearrangeinforecordMapper.selectByPrimaryKey(new Long(transformRecordId));
        }catch (Exception E){
            E.printStackTrace();
        }
        return null;
    }

    @Override
    public int updateRuntimeCourseArrangeInfoRecordByEntity(Runtimecoursearrangeinforecord runtimecoursearrangeinforecord) {
        try{
            return runtimecoursearrangeinforecordMapper.updateByPrimaryKeySelective(runtimecoursearrangeinforecord);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<Runtimecoursearrangeinforecord> getRuntimeCourseArrangeInfoRecords() {
        try{
            return runtimecoursearrangeinforecordMapper.getRuntimeCourseArrangeInfoRecords();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

}
